using KrasDD.Models;
using KrasDD.Services.Interfaces;

namespace KrasDD.Services.Implementations
{
    public class PermissionService : BaseService<PERMISSION>, IPermissionService
    {
        public PermissionService(IFreeSql freeSql, IServiceProvider serviceProvider) : base(freeSql, serviceProvider)
        {
        }

        public async Task<List<ACCESS>> GetAccessesAsync(string permissionId)
        {
            return await _freeSql.Select<ACCESS>()
                .Where(x => x.RELATED_ID == permissionId)
                .ToListAsync();
        }
    }
}
